package _spring_test._jdbc;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;

import java.util.UUID;

/**
 * @Author: huangya
 * @Date: 2020/5/1
 * @Description:
 */
public class AccountServiceImpl implements IAccountService {

    JdbcTemplate jdbcTemplate;

    public JdbcTemplate getJdbcTemplate() {
        return jdbcTemplate;
    }

    public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
        this.jdbcTemplate = jdbcTemplate;
    }

    @Override
    public int insertAccount(){
        String sql="insert into account (id, name, age) values (?, ?, ?)";
        int count= jdbcTemplate.update(sql, new Object[]{UUID.randomUUID().toString(), "hy", 3});
        System.out.println(count);
        return count;
    }


}
